package com.taotao.manage.controller.api;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.taotao.common.bean.ItemCatResult;
import com.taotao.manage.service.ItemCatService;

@Controller
@RequestMapping("/api")
public class ApiItemCatController {
	
	@Autowired
	ItemCatService itemCatService;
	
	@RequestMapping(value="/item/cat",method = RequestMethod.GET)
	public ResponseEntity<ItemCatResult> queryAllItemCat(){
		try {
			ItemCatResult itemCatData= itemCatService.queryAllItemCat();
			return ResponseEntity.ok(itemCatData);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
	}
	
}









